<?php

namespace lc\middleware;

use lc\helpers\Helper;
use think\facade\Config;

class ApiLogs
{
    public function handle($request, \Closure $next)
    {
        $rdsConf = Config::get('lc.redis');
        if (!empty($rdsConf['log_ignore_params'])) {
            $data = $request->except($rdsConf['log_ignore_params']);
        } else {
            $data = $request->param();
        }
        Helper::apiLogs($data);

        return $next($request);
    }
}